﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/Index.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Products_Default" %>
<%@ Import Namespace="webapp4U" %>
<%@ MasterType VirtualPath="~/MasterPage/Index.master" %> 
<%@ Register Assembly="webapp4U" Namespace="webapp4U.UI" TagPrefix="webapp4U"  %>
<%@ Register Src="~/Usercontrol/Title.ascx" TagName="Title" TagPrefix="uc" %>
<%@ Register src="~/Usercontrol/ShoppingCart.ascx" tagname="ShoppingCart" tagprefix="uc5" %>
<%@ Register TagPrefix="uc" Src="~/Usercontrol/ProductByParent.ascx" TagName="ProductByParent" %>
 

<asp:Content ID="Content1" ContentPlaceHolderID="ContentDynamic" Runat="Server">
    <uc:Title runat="server" ID="Title" />
    <asp:UpdatePanel ID="UserUpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>    
    
            <table>
            <tr>
                <td bgcolor="#ffffff" width="75%" class="vertical_aligntop">
                    <uc:ProductByParent ID="ProductByParent" runat="server" />                    
                </td>
            </tr>
            <tr>
                <td bgcolor="#ffffff" width="75%" class="vertical_aligntop">
                    <asp:Panel runat="server" ID="Panel_ProductByCate">
                      <!-- begin San Pham -->
                      <asp:DataList ID="ItemsDataList" runat="server" Width="100%" 
                      RepeatDirection="Horizontal"   
                      EnableViewState="False" 
                      CellPadding="0" 
                      ItemStyle-HorizontalAlign="left"
                      RepeatColumns="3" onitemdatabound="ItemsDataList_ItemDataBound" CssClass="table_product">
                          <ItemStyle HorizontalAlign="Left" />
                        <ItemTemplate>
                            <table border="0" align="center" width="100%" style="height:100%;">
                                <tr>
                                    <td align="center" style="width:100%; height:100%">
                                        <a href="<%=Globals.ApplicationPath %>Page/Products/ProductDetail.aspx?ItemKey=<%#Eval("itemkey")%>" class="margin_all">
                                            <img width="119" height="141" onmouseover="showtrail('<%=Globals.ApplicationPath %>Page/Products/Image.ashx?Size=L&ImageUrl=<%# Eval("ImageUrl") %>','<%# Eval("Description")%>',500,500)" onmouseout="hidetrail();" border="0" src='<%=Globals.ApplicationPath %>Page/Products/Image.ashx?Size=M&ImageUrl=<%# Eval("ImageUrl") %>' />
                                            
                                        </a>
                                        
                                    </td>
                                </tr>                             
                                <tr>
                                    <td align="center" style="width:100%; height:100%">
                                        <a href="<%=Globals.ApplicationPath %>Page/Products/ProductDetail.aspx?ItemKey=<%#Eval("itemkey")%>" class="margin_all">
                                            <div class="product_tilte margin_bottom"><%# Eval("Description")%></div>
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" style="width:100%; height:100%">
                                        <a href="<%=Globals.ApplicationPath %>Page/Products/ProductDetail.aspx?ItemKey=<%#Eval("itemkey")%>" class="margin_all">
                                            <span class="product_price margin_bottom"> 
                                                <%=ResourceManager.GetString("Product_Price") %>: 
                                                <asp:Label ID="lblPrice" Text='<%#GetPrice((float)Eval("UnitPrice")) %>' runat="server" ></asp:Label>
                                            </span>
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" style="width:100%; height:100%">
                                        <div class="margin_all">                                              
                                               <webapp4U:Button ID="btnProductOrder" Text="Đặt hàng" CssClass="bt_submit" ResourceName="Product_Order" runat="server" OnClick="btn_ProductOrder_Click" /> 
                                              <webapp4U:Button ID="btnAddToCart" Text="Thêm vào giỏ hàng" ResourceName="Product_AddToCart" runat="server" CssClass="bt_submit" />
                                            
                                            <asp:Panel runat="server" ID="PanelAddToCart">
                                                <input type="hidden" id="txtItemkey" value='<%#Eval("ItemKey")%>' runat="server" />                                 
                                                <%--<asp:Image ID="testImage" runat="server" CssClass="img" /> --%>                                            
                                            </asp:Panel>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                      </asp:DataList>
                    <!-- end San Pham -->
                    </asp:Panel>
                </td>
            </tr>
            </table>

            <div align="center">
                <asp:Panel ID="DisplayPager" Visible="True" runat="server">
                    <div align="center">
                        <table cellpadding="2" cellspacing="0" border="0" width="100%" align="center">
                            <tr>
                                <td valign="middle" align="center">
                                    <webapp4U:Pager ID="Pager" runat="server" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </asp:Panel>
            </div>

        </ContentTemplate>
    </asp:UpdatePanel>    
</asp:Content>

